<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<link href="dist/css/bootstrap.css" rel="stylesheet" type="text/css"
	media="all">
<script src="dist/js/jquery-1.9.1.min.js"></script>
<script src="dist/js/jquery.validate.min.js"></script>
<script src="dist/js/custom-validation.js"></script>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Add New Project</title>
<script src="dist/js/jquery-1.9.1.min.js"></script>
<script src="dist/js/jquery.validate.min.js"></script>
<script src="dist/js/project-validation.js"></script>

</head>
<body>
	<div class="container" style="height: 410px">
		<table>
			<tr>
				<td valign="top">
					<form action="addNewProject.action" id="projectForm"
						name="addProject">
						<table>
							<tr>
								<td>
									<h4>Project Name :</h4>
								</td>
								<td><input type="text" class="form-control"
									placeholder="Project Name" id="project_name"
									name="project_name"></td>
								<td><label class="error" for="project_name" style="color: red"
									generated="true"></label></td>
							</tr>
							<tr>
								<td><h4>Project Agreement :</h4></td>
								<td><input type="text" class="form-control"
									placeholder="Project Agreement" id="project_agr"
									name="project_agr"></td>
								<td><label class="error" for="project_agr" generated="true" style="color: red"></label></td>
							</tr>
							<tr>
								<td></td>
								<td><button class="btn btn-sm btn-primary btn-block"
										type="submit">Add</button></td>
							</tr>
						</table>
					</form>

				</td>
			</tr>
		</table>
	</div>
</body>
 <script>
  $(function() {
    $("#addProject").validate({
        rules: {
        	project_name: "required",
        	project_agr: "required",
        },
        // Specify the validation error messages
        messages: {
        	project_name: "Please enter project name",
            project_agr: "Please enter project agreement",
        },
        submitHandler: function(form) {
            form.submit();
        }
    });
  });
</script>
</html>